﻿using System.Collections.Generic;
using System.Threading.Tasks;

namespace AlipayPay.Infrastructure.EntitiyExtensions
{
    public interface IRepository<T> where T : class, new()
    {
        /// <summary>
        /// 异步添加
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        void AddAsync(T entity);

        /// <summary>
        /// 批量插入
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        void AddRangeAsync(List<T> entity);

        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        void DelAsync(T entity);

        /// <summary>
        /// 批量删除实体
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        void DelRangeAsync(List<T> entity);

    }
}
